import {
  ConnectedSocket,
  MessageBody,
  SubscribeMessage,
  WebSocketGateway,
} from '@nestjs/websockets';
import * as WebSocket from 'ws';

@WebSocketGateway(4002)
export class WsStartGateway {
  @SubscribeMessage('ws')
  hello(@MessageBody() data: any): any {
    return {
      event: 'hello',
      data: data,
      msg: 'success',
    };
  }
}

// {
//   "event" : "ws",
//   "data" : "测试数据1"
//}
